﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Model;
using MsDAL;
using System.ComponentModel;
using Components;

namespace ServiceHelper
{
    [DataObjectAttribute]
    public partial class Bas0a03Manager : Bas0a03Base
    {
        private static Bas0a03Manager _entity;

        public static Bas0a03Manager Entity
        {
            get
            {
                if (_entity == null)
                    _entity = new Bas0a03Manager();
                return _entity;
            }
        }

        #region 个人代码
        public string SaveData(Hashtable tb, string action, string usercode)
        {
            List<SqlApp> lst = new List<SqlApp>();

            Bas0a03 model = new Bas0a03();
            CommonUtil.GetInstance.CopyProperties(tb, model);

            model.Muser = Context.GetAppByUserCode(usercode);

            if ("A" == action)
            {
                //查询状态，默认为1
                Bas0a00 statusModel = Bas0a00Manager.Entity.GetModelById(1);
                if (statusModel == null) return "当前系统常量未设置，请联系管理员！";

                model.Listid = Sys0a60Manager.Entity.CreateSn("bas0a03_listid", usercode);
                model.Valuecode2 = statusModel.Valuecode;
                model.Valuename2 = statusModel.Valuename;

                lst.Add(this.Add(model));
            }

            return CommonManager.Entity.SaveData(lst);
        }

        #endregion
    }
}



